ALMaSS  1.0
The Animal, Landscape and Man Simulation System
Vole_Female Class Reference

The class for female voles. More...

#include <vole_all.h>

Inheritance diagram for Vole_Female:
Vole_JuvenileFemale Vole_Base TAnimal TALMaSSObject

Public Member Functions

 Vole_Female (struct_Vole_Adult *p_aVoleStruct)
 Vole_Female constructor. More...
 
void ReInit (struct_Vole_Adult *p_aVoleStruct)
 
virtual ~Vole_Female ()
 
virtual void Step ()
 Female vole Step. More...
 
int SupplyNoOfYoung ()
 
int SupplyMateId ()
 
int SupplyMateSB ()
 
unsigned SupplyYoungAge ()
 
bool SupplyPregnant ()
 
void Set_MateState (int MateState)
 
void OnInfanticideAttempt ()
 Determines whether an infanticide attempt will succeed. More...
 
- Public Member Functions inherited from Vole_JuvenileFemale
 Vole_JuvenileFemale (struct_Vole_Adult *p_aVoleStruct)
 Vole_JuvenileFemale constructor. More...
 
virtual ~Vole_JuvenileFemale ()
 
virtual bool OnFarmEvent (FarmToDo event)
 External event handler. More...
 
virtual void BeginStep ()
 Female vole BeginStep. More...
 
virtual void EndStep ()
 Female vole EndStep. More...
 
virtual void OnKilled ()
 Death from external entity. More...
 
- Public Member Functions inherited from Vole_Base
 Vole_Base (struct_Vole_Adult *p_aVoleStruct)
 Constructor for Vole_Base. More...
 
virtual ~Vole_Base ()
 
virtual void Init (struct_Vole_Adult *p_aVoleStruct)
 
void st_Dying ()
 All voles end here on death. More...
 
void SetBreedingSeason (bool a_flag)
 Set Breeding Season flag. More...
 
void SetWeight (double W)
 
void Setm_Mature ()
 
void Set_BirthYear (int BirthYear)
 
void Set_MotherId (unsigned MotherIdNo)
 
void Set_FatherId (unsigned FatherIdNo)
 
void Set_NoYoungTot (int a_NoOfYoung)
 
void Set_XBorn (int a_Location_x)
 
void Set_YBorn (int a_Location_y)
 
void Set_ElemBorn (int a_Location_x, int a_Location_y)
 
void Set_VegBorn (int a_Location_x, int a_Location_y)
 
void Set_PolyRefBorn (int a_Location_x, int a_Location_y)
 
void Set_Age (int Age)
 
virtual int WhatState ()
 
bool SupplyBornLastYear ()
 Were we born this year? More...
 
bool SupplyTerritorial ()
 
int SupplyFatherId ()
 
int SupplyMotherId ()
 
bool SupplySex ()
 
int SupplyBirthYear ()
 
int SupplyTotNoYoung ()
 
int SupplyXBorn ()
 
int SupplyYBorn ()
 
int SupplyPolyRefBorn ()
 
int SupplyElemBorn ()
 
TTypesOfLandscapeElement SupplyElemType ()
 
int SupplyVegBorn ()
 
int SupplyTerrRange ()
 
double SupplyWeight ()
 
int SupplyIDNo ()
 
bool SupplyMature ()
 
int SupplyDeathCause ()
 
unsigned SupplyAge ()
 
unsigned SupplyX ()
 
unsigned SupplyY ()
 
bool SupplyInTrap ()
 
InTrapPosition SupplyTrapPosition ()
 
void SetFree ()
 
int SupplyHomoZyg ()
 
int SupplyHeteroZyg ()
 
int SupplyAllele (int locus, int allele)
 
uint32 SupplyMyAllele (int i, int j)
 
int GetGeneticFlag ()
 
int GetDirectFlag ()
 
void SetGeneticFlag ()
 
void SetDirectFlag ()
 
void UnsetGeneticFlag ()
 
void UnsetDirectFlag ()
 
GeneticMaterial SupplyGenes ()
 
virtual bool MortalityTest ()
 Do a mortality test. More...
 
void CopyMyself (VoleObject a_vole)
 Duplicates a vole. More...
 
void SetFertile (bool f)
 Set the male vole fertility. More...
 
bool GetFertile ()
 Get the male vole fertility. More...
 
- Public Member Functions inherited from TAnimal
unsigned SupplyFarmOwnerRef ()
 
AnimalPosition SupplyPosition ()
 
APoint SupplyPoint ()
 
int SupplyPolygonRef ()
 
int Supply_m_Location_x ()
 
int Supply_m_Location_y ()
 
virtual void KillThis ()
 
virtual void CopyMyself ()
 
void SetX (int a_x)
 
void SetY (int a_y)
 
 TAnimal (int x, int y, Landscape *L)
 
virtual void ReinitialiseObject (int x, int y, Landscape *L)
 Used to re-use an object - must be implemented in descendent classes. More...
 
virtual void Dying ()
 
void CheckManagement (void)
 
void CheckManagementXY (int x, int y)
 
- Public Member Functions inherited from TALMaSSObject
int GetCurrentStateNo ()
 Returns the current state number. More...
 
void SetCurrentStateNo (int a_num)
 Sets the current state number. More...
 
bool GetStepDone ()
 Returns the step done indicator flag. More...
 
void SetStepDone (bool a_bool)
 Sets the step done indicator flag. More...
 
virtual void ReinitialiseObject ()
 Used to re-use an object - must be implemented in descendent classes. More...
 
 TALMaSSObject ()
 The constructor for TALMaSSObject. More...
 
virtual ~TALMaSSObject ()
 The destructor for TALMaSSObject. More...
 
void OnArrayBoundsError ()
 Used for debugging only, tests basic object properties. More...
 

Protected Member Functions

TTypeOfVoleState st_ReproBehaviour ()
 Reproductive switch. More...
 
TTypeOfVoleState st_UpdateGestation ()
 Gestation control. More...
 
TTypeOfVoleState st_BecomeReproductive ()
 Female vole maturation control. More...
 
TTypeOfVoleState st_GiveBirth ()
 Litter production. More...
 
TTypeOfVoleState st_Lactating ()
 Lactation. More...
 
int st_Evaluate_n_Explore ()
 Main territory evaluation behaviour. More...
 
int st_Special_Explore ()
 Post weaning territory expansion. More...
 
TTypeOfVoleState st_Mating ()
 Female mating. More...
 
- Protected Member Functions inherited from Vole_JuvenileFemale
int Dispersal (double p_OldQual, int p_Distance)
 Female dispersal. More...
 
int st_Evaluate_n_Explore ()
 Main territory evaluation behaviour. More...
 
void st_BecomeSubAdult (void)
 
virtual void SetLocation ()
 Location map function. More...
 
virtual void FreeLocation ()
 Location map function. More...
 
virtual bool GetLocation (int px, int py)
 Location map function. More...
 
- Protected Member Functions inherited from Vole_Base
virtual void RodenticideIngestion (void)
 
double CalculateCarryingCapacity (int x, int y, int a_ddep)
 
int MoveQuality (int p_x, int p_y)
 Test a location for quality while moving. More...
 
void MoveTo (int p_Vector, int p_Distance, int iterations)
 Movement. More...
 
void DoWalking (int p_Distance, int &p_Vector, int &vx, int &vy)
 Walking. More...
 
void DoWalkingCorrect (int p_Distance, int &p_Vector, int &vx, int &vy)
 Walking where there is a danger of stepping off the world. More...
 
void Escape (int p_Vector, int p_Distance)
 Dispersal - directed movement. More...
 
void CheckTraps ()
 
- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 

Protected Attributes

int m_MateLive
 
int m_MatesIdNo
 
int m_NoOfYoung
 The number of young in the current litter (if one). More...
 
bool m_Pregnant
 A flag indicating whether pregnant or not. More...
 
int m_DaysUntilBirth
 A counter counting down gestation days. More...
 
unsigned m_YoungAge
 The age of current litter in days. More...
 
GeneticMaterial m_MatesGenes
 The DNA passed from the male on mating. More...
 
- Protected Attributes inherited from Vole_Base
int m_BirthYear
 
bool m_BornLastYear
 A flag set if the female was born the year before. More...
 
unsigned int m_MinTerrRange
 
unsigned m_MotherId
 
unsigned m_FatherId
 
int m_Death
 
int m_TerrRange
 
bool m_Sex
 
bool m_Mature
 
int m_Age
 
int m_XBorn
 
int m_YBorn
 
int m_PolyRefBorn
 
int m_ElemBorn
 
int m_VegBorn
 
int m_LifeSpan
 
double m_Weight
 
bool m_fertile
 Flag indicating the fertility state (true means fertile)
More...
 
int m_NoOfYoungTotal
 
int m_DispVector
 
bool m_Have_Territory
 
int m_Reserves
 
unsigned IDNo
 
int SimH
 
int SimW
 
GeneticMaterial m_MyGenes
 
InTrapPosition m_intrappos
 
- Protected Attributes inherited from TAnimal
int m_Location_x
 
int m_Location_y
 
Landscapem_OurLandscape
 
- Protected Attributes inherited from TALMaSSObject
int m_CurrentStateNo
 The basic state number for all objects - '-1' indicates death. More...
 
bool m_StepDone
 Indicates whether the iterative step code is done for this timestep. More...
 

Additional Inherited Members

- Public Attributes inherited from Vole_Base
TTypeOfVoleState CurrentVState
 
Vole_Population_Managerm_OurPopulation
 
- Static Protected Attributes inherited from Vole_Base
static unsigned int m_MaxMaleTerritorySize = 0
 
static unsigned int m_MaxFemaleTerritorySize = 0
 
static unsigned int m_MinMaleTerritorySize = 0
 
static unsigned int m_MinFemaleTerritorySize = 0
 
static double m_MinFVoleHabQual = 0
 
static double m_MinJMVoleHabQual = 0
 
static double m_MinMVoleHabQual = 0
 
static double m_MaleTerritoryRangeSlope = 0
 
static double m_FemaleTerritoryRangeSlope = 0
 
static double m_FHabQualThreshold3
 
static double m_FHabQualThreshold2
 
static double m_FHabQualThreshold1
 
static double m_MHabQualThreshold3
 
static double m_MHabQualThreshold2
 
static double m_MHabQualThreshold1
 
static bool m_BreedingSeason = false
 

Detailed Description

The class for female voles.

Contains all the behaviour specific to the female vole. The differences between the male and female are primarily in female reproductive behaviour, but there are small differences in other behaviours requiring re-implementation of many of the behaviours (e.g. dispersal).

Constructor & Destructor Documentation

◆ Vole_Female()

Vole_Female::Vole_Female ( struct_Vole_Adult p_aVoleStruct)

Vole_Female constructor.

1852  :Vole_JuvenileFemale(p_aVoleStruct)
1853 {
1854  m_NoOfYoung = 0;
1855  m_Pregnant = false;
1858  m_MatesIdNo = -1;
1860  m_Age = MinReproAgeF + 1;
1861  m_DaysUntilBirth = 0;
1862 #ifdef __VOLEPESTICIDEON
1863  Vole_Female::m_EndoCrineDisruptionGestationLength = cfg_VoleEndoCrineDisruptionGestationLength.value();
1864  m_pesticideloadindex = 0;
1865  for (int i = 0; i<21; i++) m_pesticideloadarray[i] = 0;
1866 #endif
1867 
1868 }
static CfgInt cfg_VoleEndoCrineDisruptionGestationLength("VOLE_ENDOCRINEDISPRUPTORGESTATION", CFG_CUSTOM, 21)
const int WeanedWeight
Definition: Vole_all.cpp:131
int MinReproAgeF
Definition: Vole_all.cpp:147
int value(void)
Definition: configurator.h:98
double m_Weight
Definition: vole_all.h:192
unsigned int m_MinTerrRange
Definition: vole_all.h:164
int m_Age
Definition: vole_all.h:178
static unsigned int m_MinFemaleTerritorySize
Definition: vole_all.h:222
int m_TerrRange
Definition: vole_all.h:172
int m_NoOfYoung
The number of young in the current litter (if one).
Definition: vole_all.h:596
int m_DaysUntilBirth
A counter counting down gestation days.
Definition: vole_all.h:606
bool m_Pregnant
A flag indicating whether pregnant or not.
Definition: vole_all.h:601
int m_MatesIdNo
Definition: vole_all.h:591
Vole_JuvenileFemale(struct_Vole_Adult *p_aVoleStruct)
Vole_JuvenileFemale constructor.
Definition: Vole_all.cpp:1349

References cfg_VoleEndoCrineDisruptionGestationLength, Vole_Base::m_Age, m_DaysUntilBirth, m_MatesIdNo, Vole_Base::m_MinFemaleTerritorySize, Vole_Base::m_MinTerrRange, m_NoOfYoung, m_Pregnant, Vole_Base::m_TerrRange, Vole_Base::m_Weight, MinReproAgeF, CfgInt::value(), and WeanedWeight.

◆ ~Vole_Female()

Vole_Female::~Vole_Female ( )
virtual
1892 {
1893  // Nothing to do
1894 }

Member Function Documentation

◆ OnInfanticideAttempt()

void Vole_Female::OnInfanticideAttempt ( )

Determines whether an infanticide attempt will succeed.

A mate has attempted infanticide.
If they are 9 days old there is no chance of mortality otherwise it is proportional to age.
Data from M.arvalis (Heise & Lippke 1997)

2381 {
2382  //try this if she has kids
2383  if (m_NoOfYoung)
2384  {
2385  if (m_YoungAge<9)
2386  {
2387  double mortchance=g_rand_uni();
2388  if (mortchance<=InfanticideChanceByAge[m_YoungAge])
2389  {
2391 
2392  // Young are killed
2393  m_NoOfYoung=0; // will cause the vole to be mated
2394  m_Pregnant=false;
2395  }
2396  }
2397  }
2398 }
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
const double InfanticideChanceByAge[9]
Definition: Vole_all.cpp:185
Vole_Population_Manager * m_OurPopulation
Definition: vole_all.h:408
unsigned m_YoungAge
The age of current litter in days.
Definition: vole_all.h:611
void AddToNoYoungInfanticideCount(int m_NoOfYoung, int m_YoungAge)
Definition: VolePopulationManager.h:256

References Vole_Population_Manager::AddToNoYoungInfanticideCount(), g_rand_uni, InfanticideChanceByAge, m_NoOfYoung, Vole_Base::m_OurPopulation, m_Pregnant, and m_YoungAge.

Referenced by Vole_Population_Manager::SendMessage().

◆ ReInit()

void Vole_Female::ReInit ( struct_Vole_Adult p_aVoleStruct)
virtual

Reimplemented from Vole_JuvenileFemale.

1871 {
1872  Init(p_aVoleStruct);
1873  m_NoOfYoung = 0;
1874  m_Pregnant = false;
1877  m_MatesIdNo = -1;
1879  m_Age = MinReproAgeF + 1;
1880  m_DaysUntilBirth = 0;
1881 #ifdef __VOLEPESTICIDEON
1882  Vole_Female::m_EndoCrineDisruptionGestationLength = cfg_VoleEndoCrineDisruptionGestationLength.value();
1883  m_pesticideloadindex = 0;
1884  for (int i = 0; i<21; i++) m_pesticideloadarray[i] = 0;
1885 #endif
1886 
1887 }
virtual void Init(struct_Vole_Adult *p_aVoleStruct)
Definition: Vole_all.cpp:240

References cfg_VoleEndoCrineDisruptionGestationLength, Vole_Base::Init(), Vole_Base::m_Age, m_DaysUntilBirth, m_MatesIdNo, Vole_Base::m_MinFemaleTerritorySize, Vole_Base::m_MinTerrRange, m_NoOfYoung, m_Pregnant, Vole_Base::m_TerrRange, Vole_Base::m_Weight, MinReproAgeF, CfgInt::value(), and WeanedWeight.

◆ Set_MateState()

void Vole_Female::Set_MateState ( int  MateState)
inline
585 {m_MateLive = MateState;};
int m_MateLive
Definition: vole_all.h:590

References m_MateLive.

◆ st_BecomeReproductive()

TTypeOfVoleState Vole_Female::st_BecomeReproductive ( )
protected

Female vole maturation control.

Tests to see if the female should mature

2006 {
2008  {
2009  if ( m_Age>= MinReproAgeF) {
2010  Setm_Mature();
2011  }
2012  }
2013  return tovs_FEvaluateExplore;
2014 }
void Setm_Mature()
Definition: vole_all.h:300
static bool m_BreedingSeason
Definition: vole_all.h:247
bool m_Have_Territory
Definition: vole_all.h:204
@ tovs_FEvaluateExplore
Definition: vole_all.h:65

References Vole_Base::m_Age, Vole_Base::m_BreedingSeason, Vole_Base::m_Have_Territory, MinReproAgeF, Vole_Base::Setm_Mature(), and tovs_FEvaluateExplore.

Referenced by Step().

◆ st_Evaluate_n_Explore()

int Vole_Female::st_Evaluate_n_Explore ( )
protected

Main territory evaluation behaviour.

Evaluates the quality of her habitat and does some limited exploration in the surrounding area to see if she can improve it by moving.

2229 {
2230 #ifdef __USINGTRAPLINES
2231  CheckTraps();
2232 #endif
2233 /*
2234  unsigned MovementIndex;
2235  if (m_Age>90) MovementIndex=3;
2236  else if (m_Age>60) MovementIndex=2;
2237  else if (m_Age>30) MovementIndex=1;
2238  else MovementIndex=0;
2239 */
2241  // This function determines whether he must leave and whether he does
2242  // an explore. Will do this if he is not in optimal conditions
2243  if ( Qual <= m_MinFVoleHabQual )
2244  {
2245 
2246 #ifdef __VoleStarvationDays
2247  ++m_StarvationDays;
2248 #endif
2249  m_Have_Territory = false;
2250  // check an area MinFemaleMovement to FemaleMovement metres away
2251  m_DispVector = random(8);
2252  // Not quality dependent dispersal, very directed
2254  }
2255  else
2256  {
2257  m_Have_Territory = true;
2258 #ifdef __VoleStarvationDays
2259  m_StarvationDays = 0;
2260 #endif
2261  return (Dispersal(Qual,random(FemaleMovement)+ MinFemaleMovement)); // returns 1 if it has died of extra dispersal mortality or starvation
2262  }
2263 }
int random(int a_range)
Definition: ALMaSS_CmdLine.cpp:142
const unsigned FemaleMovement
Definition: Vole_all.cpp:174
CfgInt cfg_VoleDDepConst("VOLE_DDEPCONST", CFG_CUSTOM, 4)
const unsigned MinFemaleMovement
Definition: Vole_all.cpp:176
int m_Location_y
Definition: PopulationManager.h:228
int m_Location_x
Definition: PopulationManager.h:225
void CheckTraps()
Definition: Vole_all.cpp:2800
double CalculateCarryingCapacity(int x, int y, int a_ddep)
Definition: Vole_all.cpp:384
int m_DispVector
Definition: vole_all.h:202
static double m_MinFVoleHabQual
Definition: vole_all.h:224
int Dispersal(double p_OldQual, int p_Distance)
Female dispersal.
Definition: Vole_all.cpp:1817

References Vole_Base::CalculateCarryingCapacity(), cfg_VoleDDepConst, Vole_Base::CheckTraps(), Vole_JuvenileFemale::Dispersal(), FemaleMovement, Vole_Base::m_DispVector, Vole_Base::m_Have_Territory, TAnimal::m_Location_x, TAnimal::m_Location_y, Vole_Base::m_MinFVoleHabQual, MinFemaleMovement, random(), and CfgInt::value().

Referenced by Step().

◆ st_GiveBirth()

TTypeOfVoleState Vole_Female::st_GiveBirth ( )
protected

Litter production.

Produces a litter and records the information if necessary

2025 {
2026  // TODO must locate the nest position if this is considered important - currently it is set as the centre of the territory
2028  {
2029  // Must produce young
2030  int yr = 0;
2031  if (m_BornLastYear) yr = 1;
2033  m_Pregnant = false;
2034 #ifdef __VOLEPESTICIDEON
2036  {
2037  double dose = 0.0;
2038  double survive = 1.0;
2040  {
2041  for (int i = 0; i < 21; i++) dose += m_pesticideloadarray[i];
2042  dose /= 21;
2044  }
2045  else
2046  {
2047  dose = m_pesticideInfluenced3 - cfg_PesticideAccumulationThreshold.value();
2048  m_pesticideInfluenced3 = 0;
2049  }
2050  if (dose > 0) // this has the maximum dose received
2051  {
2052  // Calc dose response in terms of chance of death for individual offspring
2053  survive = 1 - (cfg_PesticideLitterSizeReduction.value() * dose);
2054  }
2055  // This applies the survival probability to each individual - why do we not do this to the litter as a whole
2056  // - this is because the probability may be too small to get a % response from e.g. 4 young
2057  int ny = 0;
2058  for (int y = 0; y < m_NoOfYoung; y++) if (g_rand_uni() < survive)
2059  {
2060  ny++;
2061  m_OurPopulation->AddToNotImpacted();
2062  }
2063  else m_OurPopulation->AddToImpacted();
2064  m_NoOfYoung = ny;
2065  }
2066  if (m_NoOfYoung > 0) m_OurPopulation->incLittersProduced(); else m_OurPopulation->incLittersLost();
2067 #endif
2068  // Must age young
2069  m_YoungAge = 0;
2070  // Update the YoungProduced Today Counter
2073  return tovs_ReproBehaviour; //NB if m_NoOfYoung is zero due to pesticide effects this will quietly be dealt with by the repro switch
2074  }
2075  else
2076  {
2077  m_NoOfYoung = 0;
2078  }
2079  m_Pregnant = false;
2080  return tovs_FEvaluateExplore;
2081 }
static CfgFloat cfg_PesticideAccumulationThresholdModelink2("VOLE_PESTICDEACCUMULATIONTHRESHOLD_MODELINKTWO", CFG_CUSTOM, 20.0)
static CfgFloat cfg_PesticideAccumulationThreshold("VOLE_PESTICDEACCUMULATIONTHRESHOLD", CFG_CUSTOM, 20.0)
static CfgFloat cfg_PesticideLitterSizeReduction("VOLE_PCIDE_LITTERSIZEREDUCTION", CFG_CUSTOM, 0.0038)
double value(void)
Definition: configurator.h:118
int SupplyDayInYear(void)
Definition: landscape.h:1596
TTypesOfPesticide SupplyPesticideType(void)
Definition: landscape.h:433
Landscape * m_OurLandscape
Definition: PopulationManager.h:229
int m_NoOfYoungTotal
Definition: vole_all.h:200
bool m_BornLastYear
A flag set if the female was born the year before.
Definition: vole_all.h:162
void AddToYoung(int young)
Definition: VolePopulationManager.h:250
int ReproTable[4][12]
Definition: VolePopulationManager.h:221
@ ttop_ModelinkPesticide
Definition: landscape.h:71
@ ttop_ModelinkPesticide21TWA
Definition: landscape.h:72
@ tovs_ReproBehaviour
Definition: vole_all.h:66

References Vole_Population_Manager::AddToYoung(), cfg_PesticideAccumulationThreshold, cfg_PesticideAccumulationThresholdModelink2, cfg_PesticideLitterSizeReduction, g_rand_uni, Vole_Base::m_BornLastYear, Vole_Base::m_Have_Territory, m_NoOfYoung, Vole_Base::m_NoOfYoungTotal, TAnimal::m_OurLandscape, Vole_Base::m_OurPopulation, m_Pregnant, m_YoungAge, Vole_Population_Manager::ReproTable, Landscape::SupplyDayInYear(), Landscape::SupplyPesticideType(), tovs_FEvaluateExplore, tovs_ReproBehaviour, ttop_ModelinkPesticide, ttop_ModelinkPesticide21TWA, and CfgFloat::value().

Referenced by Step().

◆ st_Lactating()

TTypeOfVoleState Vole_Female::st_Lactating ( )
protected

Lactation.

Once the litter reaches weaning age then individual voles are created and set in motion by this method. Pesticide effects may be specified here too.

2091 {
2092  if( m_YoungAge++ >= WeanedAge )
2093  {
2094  struct_Vole_Adult* av;
2095  av = new struct_Vole_Adult;
2096  av->VPM = m_OurPopulation;
2097  av->L = m_OurLandscape;
2098  av->m_flag = true; // Used to signal pesticide effect to CreateObjects
2099 #ifdef __VOLEPESTICIDEON
2100  double mdelay = 0;
2102  {
2103  double dose = 0.0;
2104  double survive = 1.0;
2106  {
2107  for (int i=0; i<21; i++) dose+=m_pesticideloadarray[i];
2108  dose /=21;
2110  } else
2111  {
2112  dose = m_pesticideInfluenced3-cfg_PesticideAccumulationThreshold.value();
2113  m_pesticideInfluenced3=0;
2114  }
2115  if ( dose > 0 ) // this has the maximum dose received
2116  {
2117  // Calc dose response in terms of chance of death for individual offspring
2118  survive = 1-(cfg_PesticideWeaningReduction.value() * dose);
2119  mdelay = cfg_PesticideFemaleMaturityDelay.value() * dose;
2120  }
2121  // This applies the survival probability to each individual - why do we not do this to the litter as a whole
2122  // - this is because the probability may be too small to get a % response from e.g. 4 young
2123  int ny=0;
2124  for (int y=0; y<m_NoOfYoung; y++) if (g_rand_uni()<survive) ny++;
2125  m_NoOfYoung = ny;
2126  }
2127 #endif
2128  unsigned MotherIdNo = SupplyIDNo();
2129  unsigned FatherIdNo = SupplyMateId();
2130 
2131  // Create the new voles (50% chance of male/female)
2132  for (int i=0; i<m_NoOfYoung; i++)
2133  {
2137  av->FatherId = FatherIdNo;
2138  av->MotherId = MotherIdNo;
2139  av->x = ((m_Location_x+random(10))%m_OurPopulation->SimW);
2140  av->y = ((m_Location_y+random(10))%m_OurPopulation->SimH);
2141  // Do the genetics
2143  av->Genes.Mutation_4();
2144 #ifdef __Mutation
2145  //av->Genes256_16.Mutation_3(); // This is only one of a number of mutation types we can use
2146 #endif
2147  if (random(2)==1) // Even sex ratio
2148  {
2149  // Males
2150 #ifdef __VOLEPESTICIDEON
2152  {
2153  // If her mate was pesticide influenced then ensure all male offspring are also
2154  // by setting the gene on if we are useing Vinclozolin
2155  // If either the male was directly affected, or the female directly during gestation
2156  if ( m_pesticideInfluenced1 )
2157  {
2158  av->m_dflag = true;
2159  av->m_gflag = true;
2160  m_OurPopulation->AddToImpacted();
2161  }
2162  // Otherwise if the male was genetically affected
2163  else if (MatesGenes.GetGeneticFlag())
2164  {
2165  av->m_gflag = true;
2166  av->m_dflag=false;
2167  m_OurPopulation->AddToGeneticImpacted();
2168  }
2169  else
2170  {
2171  av->m_gflag=false;
2172  av->m_dflag=false;
2173  m_OurPopulation->AddToNotImpacted();
2174  }
2175  }
2177  {
2178  // If either the male was directly affected, or the female directly during gestation
2179  if ( m_pesticideInfluenced1 )
2180  {
2181  av->m_dflag = true;
2182  av->m_gflag = false;
2183  m_OurPopulation->AddToImpacted();
2184  }
2185  else
2186  {
2187  av->m_gflag=false;
2188  av->m_dflag=false;
2189  m_OurPopulation->AddToNotImpacted();
2190  }
2191  }
2192  else
2193  {
2194  av->m_gflag=false;
2195  av->m_dflag=false;
2196  }
2197 #endif
2199  }
2200  else {
2201 #ifdef __VOLEPESTICIDEON
2203  {
2204  av->misc_use = mdelay;
2205  }
2206  else av->misc_use = 0.0;
2207 #endif
2209  }
2210  }
2212  m_Reserves=0; // all reserves used up
2213  m_NoOfYoung=0; // No more young to feed
2214  delete av; // clean up
2215  return tovs_SpecialExplore; // CurrentVState=14 Special Explore
2216  }
2217  else return tovs_Lactating; // carry on feeding young
2218 }
const unsigned WeanedAge
Definition: Vole_all.cpp:129
static CfgFloat cfg_PesticideFemaleMaturityDelay("VOLE_PCIDE_FEMALEMATURITYDELAY", CFG_CUSTOM, 0.0192)
static CfgFloat cfg_PesticideWeaningReduction("VOLE_PCIDE_WEANINGREDUCTION", CFG_CUSTOM, 0.0017)
void Recombine(GeneticMaterial *Gen21, GeneticMaterial *Gene2)
Definition: GeneticMaterial.cpp:338
void Mutation_4()
Definition: GeneticMaterial.cpp:538
int SupplyPolyRef(int a_x, int a_y)
Definition: landscape.h:1488
TTypesOfVegetation SupplyVegType(int a_x, int a_y)
Definition: landscape.h:1321
TTypesOfLandscapeElement SupplyElementType(int a_polyref)
Definition: landscape.h:1110
int SimH
Definition: PopulationManager.h:511
int SimW
Definition: PopulationManager.h:511
int SupplyIDNo()
Definition: vole_all.h:364
GeneticMaterial m_MyGenes
Definition: vole_all.h:213
int m_Reserves
Definition: vole_all.h:206
GeneticMaterial m_MatesGenes
The DNA passed from the male on mating.
Definition: vole_all.h:616
int SupplyMateId()
Definition: vole_all.h:579
void CreateObjects(VoleObject ob_type, TAnimal *pvo, struct_Vole_Adult *as, int number)
Definition: VolePopulationManager.cpp:3455
void AddToJuvs(int juvs)
Definition: VolePopulationManager.h:255
A struct for passing data to create a new vole.
Definition: vole_all.h:123
int FatherId
Definition: vole_all.h:135
int y
Definition: vole_all.h:126
int MotherId
Definition: vole_all.h:136
GeneticMaterial Genes
Definition: vole_all.h:141
Vole_Population_Manager * VPM
Definition: vole_all.h:139
bool m_flag
Definition: vole_all.h:142
bool m_gflag
Definition: vole_all.h:143
int ElemBorn
Definition: vole_all.h:132
int PolyRefBorn
Definition: vole_all.h:131
int x
Definition: vole_all.h:125
int VegBorn
Definition: vole_all.h:133
bool m_dflag
Definition: vole_all.h:144
Landscape * L
Definition: vole_all.h:138
double misc_use
Definition: vole_all.h:145
@ ttop_Vinclozolin
Definition: landscape.h:70
@ ttop_ReproductiveEffects
Definition: landscape.h:69
@ vob_JuvenileMale
Definition: vole_all.h:100
@ vob_JuvenileFemale
Definition: vole_all.h:101
@ tovs_Lactating
Definition: vole_all.h:67
@ tovs_SpecialExplore
Definition: vole_all.h:72

References Vole_Population_Manager::AddToJuvs(), cfg_PesticideAccumulationThreshold, cfg_PesticideAccumulationThresholdModelink2, cfg_PesticideFemaleMaturityDelay, cfg_PesticideWeaningReduction, Vole_Population_Manager::CreateObjects(), struct_Vole_Adult::ElemBorn, struct_Vole_Adult::FatherId, g_rand_uni, struct_Vole_Adult::Genes, struct_Vole_Adult::L, struct_Vole_Adult::m_dflag, struct_Vole_Adult::m_flag, struct_Vole_Adult::m_gflag, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MatesGenes, Vole_Base::m_MyGenes, m_NoOfYoung, TAnimal::m_OurLandscape, Vole_Base::m_OurPopulation, Vole_Base::m_Reserves, m_YoungAge, struct_Vole_Adult::misc_use, struct_Vole_Adult::MotherId, GeneticMaterial::Mutation_4(), struct_Vole_Adult::PolyRefBorn, random(), GeneticMaterial::Recombine(), Population_Manager::SimH, Population_Manager::SimW, Landscape::SupplyElementType(), Vole_Base::SupplyIDNo(), SupplyMateId(), Landscape::SupplyPesticideType(), Landscape::SupplyPolyRef(), Landscape::SupplyVegType(), tovs_Lactating, tovs_SpecialExplore, ttop_ModelinkPesticide, ttop_ModelinkPesticide21TWA, ttop_ReproductiveEffects, ttop_Vinclozolin, CfgFloat::value(), struct_Vole_Adult::VegBorn, vob_JuvenileFemale, vob_JuvenileMale, struct_Vole_Adult::VPM, WeanedAge, struct_Vole_Adult::x, and struct_Vole_Adult::y.

Referenced by Step().

◆ st_Mating()

TTypeOfVoleState Vole_Female::st_Mating ( )
protected

Female mating.

The mating state is where genes are passed and any genetic effects from the male need to be evaluated (e.g. pesticide induced infertility)

2342 {
2343  //if it is the breeding season
2344  if ( m_BreedingSeason )
2345  {
2346  // Find a male if there is one
2347 
2348  Vole_Male* Mate=m_OurPopulation->FindClosestMale(m_Location_x, m_Location_y, m_MaxMaleTerritorySize); // Changed from a constant of 20 to her Territory range **//TD 090519
2349  // Get his genes if we found a mate
2350  if (Mate)
2351  {
2352  m_MatesGenes=Mate->SupplyGenes();
2353  m_MatesIdNo=Mate->SupplyIDNo();
2354 #ifdef __VOLEPESTICIDEON
2355  if (!Mate->GetFertile())
2356  {
2357  m_Pregnant = false;
2358  }
2359  else m_Pregnant = true;
2360 #else
2361  m_Pregnant = true;
2362 #endif
2364  }
2365  }
2366  return tovs_FEvaluateExplore;
2367 }
const unsigned TheGestationPeriod
Definition: Vole_all.cpp:127
GeneticMaterial SupplyGenes()
Definition: vole_all.h:402
bool GetFertile()
Get the male vole fertility.
Definition: vole_all.h:424
static unsigned int m_MaxMaleTerritorySize
Definition: vole_all.h:216
The class for male voles.
Definition: vole_all.h:493
Vole_Male * FindClosestMale(int p_x, int p_y, int p_steps)
Definition: VolePopulationManager.cpp:2686

References Vole_Population_Manager::FindClosestMale(), Vole_Base::GetFertile(), Vole_Base::m_BreedingSeason, m_DaysUntilBirth, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MatesGenes, m_MatesIdNo, Vole_Base::m_MaxMaleTerritorySize, Vole_Base::m_OurPopulation, m_Pregnant, Vole_Base::SupplyGenes(), Vole_Base::SupplyIDNo(), TheGestationPeriod, and tovs_FEvaluateExplore.

Referenced by Step().

◆ st_ReproBehaviour()

TTypeOfVoleState Vole_Female::st_ReproBehaviour ( )
protected

Reproductive switch.

This state is simply a switch determing what behaviour to exhibit. In the case of pesticide exposure to endocrine disruptors there may be an impact of mating with a steriel male leading to a false pregnancy. In this case m_DaysUntilBirth will be

0, but she will not be pregnant. This will have the effect of delaying mating until the counter is zero.

1975 {
1976  if (!m_Mature) return tovs_FMaturation; // Go to BecomeReproductive;
1977  else if (m_NoOfYoung>0) return tovs_Lactating; //Go to lactating
1978  else if ((!m_Pregnant) && (m_DaysUntilBirth==0)) return tovs_Mating; // Go to Mating;
1979  else return tovs_UpdateGestation; // Go to UpdateGestation;
1980 }
bool m_Mature
Definition: vole_all.h:176
@ tovs_FMaturation
Definition: vole_all.h:69
@ tovs_Mating
Definition: vole_all.h:70
@ tovs_UpdateGestation
Definition: vole_all.h:71

References m_DaysUntilBirth, Vole_Base::m_Mature, m_NoOfYoung, m_Pregnant, tovs_FMaturation, tovs_Lactating, tovs_Mating, and tovs_UpdateGestation.

Referenced by Step().

◆ st_Special_Explore()

int Vole_Female::st_Special_Explore ( )
protected

Post weaning territory expansion.

Called after weaning of a litter when the female needs to expand her territory again. This does not use the Dispersal function so avoids extra mortality at this point.

2274 {
2275  //The vole must now find a good territory
2276  // She will explore in all 8 directions from the nest and pick the best
2277  // from these and here present position
2278  unsigned coords[9][2];
2279  double qualities[9];
2280  // Check the quality here
2281  coords[8][0]=m_Location_x;
2282  coords[8][1]=m_Location_y;
2284  qualities[8]=-1;
2285  else
2286  {
2288  }
2289  // Now check the quality in all 8 directions
2290  unsigned steps = 2 * FemaleMovement+MinFemaleMovement;
2291  for (unsigned i=0; i<8; i++)
2292  {
2293  MoveTo(i,steps,10); // changes m_Location_x & y
2294  coords[i][0]=m_Location_x;
2295  coords[i][1]=m_Location_y;
2297  m_TerrRange))
2298  qualities[i]=-1;
2299  else
2300  {
2302  }
2303  }
2304  // find the best out of the nine qualities
2305  double best =qualities[8]; // here
2306  unsigned found=8; // default stay here
2307  for (unsigned i=0; i<8; i++)
2308  {
2309  if (qualities[i]>best)
2310  {
2311  best=qualities[i];
2312  found=i;
2313  }
2314  if (best>1)
2315  {
2316  if (m_Mature)
2317  {
2318  m_Have_Territory=true;
2319  }
2320  }
2321  else
2322  {
2323  m_Have_Territory=false;
2324  }
2325  FreeLocation();
2326  m_Location_x=coords[found][0];
2327  m_Location_y=coords[found][1];
2328  SetLocation();
2329  }
2330  return 0;
2331 }
void MoveTo(int p_Vector, int p_Distance, int iterations)
Movement.
Definition: Vole_all.cpp:907
virtual void FreeLocation()
Location map function.
Definition: Vole_all.cpp:1792
virtual void SetLocation()
Location map function.
Definition: Vole_all.cpp:1785
bool SupplyOlderFemales(unsigned p_x, unsigned p_y, unsigned p_Age, unsigned p_range)
Definition: VolePopulationManager.cpp:1015

References Vole_Base::CalculateCarryingCapacity(), cfg_VoleDDepConst, FemaleMovement, Vole_JuvenileFemale::FreeLocation(), Vole_Base::m_Age, Vole_Base::m_Have_Territory, TAnimal::m_Location_x, TAnimal::m_Location_y, Vole_Base::m_Mature, Vole_Base::m_OurPopulation, Vole_Base::m_TerrRange, MinFemaleMovement, Vole_Base::MoveTo(), Vole_JuvenileFemale::SetLocation(), Vole_Population_Manager::SupplyOlderFemales(), and CfgInt::value().

Referenced by Step().

◆ st_UpdateGestation()

TTypeOfVoleState Vole_Female::st_UpdateGestation ( )
protected

Gestation control.

Decreases the number of days until birth by 1, checks for special pesticide effects for vinclozolin like pesticide simulations

1992 {
1993  m_DaysUntilBirth--;
1994  if (m_DaysUntilBirth == 0) return tovs_GiveBirth; else return tovs_FEvaluateExplore;
1995 }
@ tovs_GiveBirth
Definition: vole_all.h:68

References m_DaysUntilBirth, tovs_FEvaluateExplore, and tovs_GiveBirth.

Referenced by Step().

◆ Step()

void Vole_Female::Step ( void  )
virtual

Female vole Step.

The Step is one of the three timestep divisions. This is called repeatedly after BeginStep and before EndStep, until all voles report that they are done with Step.

Most of the behaviours are controlled by moving voles between behavioural states in Step (for other models this is also done in BeginStep and EndStep).
When a vole is done for the day it will signal this by setting m_StepDone==true. NB that a call to one behaviour may trigger a call to another behaviour on the next call to step inside the same timestep. In this way a daily cycle of activity can be undertaken (i.e. do reproduction and explore)

Reimplemented from Vole_JuvenileFemale.

1907 {
1908  if (m_StepDone) return;
1909  switch (CurrentVState)
1910  {
1911  case 0: // Initial state
1913  break;
1914  case tovs_FEvaluateExplore: // Evaluate & Explore
1915  switch(st_Evaluate_n_Explore())
1916  {
1917  case 1:
1918  CurrentVState=tovs_FDying; // Die
1919  break;
1920  case 2:
1922  CurrentVState=tovs_FDying; // Die
1923  break;
1924  default:
1925  CurrentVState=tovs_ReproBehaviour; // repro behaviour
1926  }
1927  m_StepDone=true;
1928  break;
1929  case tovs_ReproBehaviour: // ReproBehaviour
1931  break;
1932  case tovs_Lactating: // Lactating
1934  m_StepDone=true;
1935  break;
1936  case tovs_GiveBirth:
1938  m_StepDone=true; // wait until next day
1939  break;
1940  case tovs_FMaturation: // Maturation
1941  CurrentVState = st_BecomeReproductive(); // only returns Eval n Explore
1942  break;
1943  case tovs_Mating: // Mating
1944  CurrentVState = st_Mating(); // only returns Eval n Explore
1945  break;
1946  case tovs_UpdateGestation: // Update Gestation
1948  break;
1949  case tovs_SpecialExplore: // Special Explore
1951  CurrentVState = tovs_ReproBehaviour; // Repro behaviour
1952  m_StepDone=true;
1953  break;
1954  case tovs_FDying: // Die
1955  FreeLocation();
1956  m_StepDone=true;
1957  break;
1958  default:
1959  m_OurLandscape->Warn("Vole_Female::Step - unknown state",NULL);
1960  exit(9);
1961  }
1962 }
CfgBool cfg_RecordVoleMort
@ tovmort_FStarve
Definition: VolePopulationManager.h:74
bool value(void)
Definition: configurator.h:135
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1579
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
Definition: PopulationManager.h:118
TTypeOfVoleState CurrentVState
Definition: vole_all.h:407
TTypeOfVoleState st_ReproBehaviour()
Reproductive switch.
Definition: Vole_all.cpp:1974
int st_Special_Explore()
Post weaning territory expansion.
Definition: Vole_all.cpp:2273
int st_Evaluate_n_Explore()
Main territory evaluation behaviour.
Definition: Vole_all.cpp:2228
TTypeOfVoleState st_Mating()
Female mating.
Definition: Vole_all.cpp:2341
TTypeOfVoleState st_BecomeReproductive()
Female vole maturation control.
Definition: Vole_all.cpp:2005
TTypeOfVoleState st_GiveBirth()
Litter production.
Definition: Vole_all.cpp:2024
TTypeOfVoleState st_UpdateGestation()
Gestation control.
Definition: Vole_all.cpp:1991
TTypeOfVoleState st_Lactating()
Lactation.
Definition: Vole_all.cpp:2090
VoleSummaryOutput * m_VoleRecordMort
Definition: VolePopulationManager.h:197
void ChangeData(int a_data, int a_value)
Definition: VolePopulationManager.cpp:4048
@ tovs_FDying
Definition: vole_all.h:73

References cfg_RecordVoleMort, VoleSummaryOutput::ChangeData(), Vole_Base::CurrentVState, Vole_JuvenileFemale::FreeLocation(), TAnimal::m_OurLandscape, Vole_Base::m_OurPopulation, TALMaSSObject::m_StepDone, Vole_Population_Manager::m_VoleRecordMort, st_BecomeReproductive(), st_Evaluate_n_Explore(), st_GiveBirth(), st_Lactating(), st_Mating(), st_ReproBehaviour(), st_Special_Explore(), st_UpdateGestation(), tovmort_FStarve, tovs_FDying, tovs_FEvaluateExplore, tovs_FMaturation, tovs_GiveBirth, tovs_Lactating, tovs_Mating, tovs_ReproBehaviour, tovs_SpecialExplore, tovs_UpdateGestation, CfgBool::value(), and Landscape::Warn().

◆ SupplyMateId()

int Vole_Female::SupplyMateId ( )
inline
579 {return m_MatesIdNo;};

References m_MatesIdNo.

Referenced by st_Lactating().

◆ SupplyMateSB()

int Vole_Female::SupplyMateSB ( )
inline
580 {return m_MateLive;};

References m_MateLive.

◆ SupplyNoOfYoung()

int Vole_Female::SupplyNoOfYoung ( )
inline
577 {return m_NoOfYoung;};

References m_NoOfYoung.

◆ SupplyPregnant()

bool Vole_Female::SupplyPregnant ( )
inline
583 {return m_Pregnant;};

References m_Pregnant.

◆ SupplyYoungAge()

unsigned Vole_Female::SupplyYoungAge ( )
inline
582 {return m_YoungAge;};

References m_YoungAge.

Member Data Documentation

◆ m_DaysUntilBirth

int Vole_Female::m_DaysUntilBirth
protected

A counter counting down gestation days.

Referenced by ReInit(), st_Mating(), st_ReproBehaviour(), st_UpdateGestation(), and Vole_Female().

◆ m_MateLive

int Vole_Female::m_MateLive
protected

Referenced by Set_MateState(), and SupplyMateSB().

◆ m_MatesGenes

GeneticMaterial Vole_Female::m_MatesGenes
protected

The DNA passed from the male on mating.

Referenced by st_Lactating(), and st_Mating().

◆ m_MatesIdNo

int Vole_Female::m_MatesIdNo
protected

◆ m_NoOfYoung

int Vole_Female::m_NoOfYoung
protected

The number of young in the current litter (if one).

Referenced by OnInfanticideAttempt(), ReInit(), st_GiveBirth(), st_Lactating(), st_ReproBehaviour(), SupplyNoOfYoung(), and Vole_Female().

◆ m_Pregnant

bool Vole_Female::m_Pregnant
protected

A flag indicating whether pregnant or not.

Referenced by OnInfanticideAttempt(), ReInit(), st_GiveBirth(), st_Mating(), st_ReproBehaviour(), SupplyPregnant(), and Vole_Female().

◆ m_YoungAge

unsigned Vole_Female::m_YoungAge
protected

The age of current litter in days.

Referenced by OnInfanticideAttempt(), st_GiveBirth(), st_Lactating(), and SupplyYoungAge().


The documentation for this class was generated from the following files: